<template>
	<view>
		<!-- 轮播图 -->
		<view>
			<uni-swiper-dot :info="info" :current="current" field="content" :mode="mode">
				<swiper class="swiper-box" @change="change" autoplay="true" interval="3000">
					<swiper-item v-for="(item ,index) in info" :key="index">
						<view class="swiper-item">
							<image src="/static/washProImg/ide.png" style="width: 100%;"></image>
						</view>
					</swiper-item>
				</swiper>
			</uni-swiper-dot>
		</view>
		<!-- 文字介绍 -->
		<view class="text">
			<text>爱坤汽车修脚店(人民路店)</text>
			<view class="score">
				<uni-rate class="xx" size="17" :readonly="true" :value="storeScore" />
				<text>{{storeScore}}分</text>
				<text>销量：332</text>
			</view>
			<text>营业时间：周一至周五 09:00-22:00</text><br />
			<text>郑州市人民路36号</text>
			<image src="/static/washProImg/plane@2x.png" mode="" style="width: 14px; height: 14px; padding-left: 10px;"></image>
		</view>
		<!-- 服务 -->
		<view class="service">
			<text>服务</text>
			<view class="serviceClassify">
				<uni-data-checkbox multiple v-model="value" :localdata="range"></uni-data-checkbox>
			</view>
			<text style="padding-left: 15px;">¥ 199</text>
			<text style="padding-left: 25px; color: red; text-decoration: line-through;">¥ 299</text><br />
			<text>服务介绍服务介绍服务介绍服务介绍服务介绍服务介绍服务介绍服务介绍服务介绍服务介绍服务介绍服务介绍</text>
		</view>
		<!-- 服务评价 -->
		<view class="evaluate">
			<text>服务评价</text>
			<!-- 评价列表 -->
			<view class="evaluateList">
				<view>
					<image src="/static/washProImg/ide.png" mode="" class="avatar"></image>
				</view>
				<view class="userMsg">
					<text>李**</text>
					<text>2022-09-10</text>
					<view>
						<uni-rate class="xx" size="18" :readonly="true" :value="userScore" />
					</view>
					<view class="evaluateContent">
						评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价内容评价
					</view>
				</view>
			</view>
		</view>
		<view style="height: 50px;"></view>
		<view class="twoBtn">
			<view class="twoBtn-button" @click="openModal">
				<image src="/static/washProImg/客服@2x.png"></image>
				<view class="twoBtn-text">联系客服</view>
			</view>
			<button @click="navigateToBuyWash">立即下单 </button>
		</view>
		<!-- 遮罩层 -->
		<view v-if="showModal" class="overlay"></view>
		<!-- 弹出框 -->
		<view v-if="showModal" class="modal">
			<view class="modal-content">
				<view class="modal-button" @click="callStore">拨打电话</view>
				<view class="modal-button" @click="copyPhoneNumber">复制电话</view>
				<view class="modal-button" @click="closeModal">取消拨号</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				storeScore: 4, //橙色星星数量
				showModal: false, // 控制弹出框显示
				phoneNumber: '123456789', // 商家电话
				info: [{ content: '' }, { content: '' }, { content: '' }, { content: '' }, { content: '' }],
				current: 0,
				mode: 'round',
				userScore: 3,
				value: 0,
			}
		},
		methods: {
			navigateToBuyWash() {
				uni.navigateTo({
					url: '/pages/washPro/orders/orders'
				});
			},
			openModal() {
				this.showModal = true; // 打开弹出框
			},
			closeModal() {
				this.showModal = false; // 关闭弹出框
			},
			callStore() {
				// 拨打电话的逻辑
				this.showModal = false; // 关闭弹出框
			},
			copyPhoneNumber() {
				// 复制电话的逻辑
				this.showModal = false; // 关闭弹出框
			},
			change(e) {
				this.current = e.detail.current;
			},
			checkboxChange: function(e) {
				var items = this.items,
					values = e.detail.value;
				for (var i = 0, lenI = items.length; i < lenI; ++i) {
					const item = items[i]
					if (values.includes(item.value)) {
						this.$set(item, 'checked', true)
					} else {
						this.$set(item, 'checked', false)
					}
				}
			}
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}

	.swiper-box {
		height: 225px;
	}

	.swiper-item {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		height: 225px;
		color: #fff;
	}

	.text text:nth-child(1) {
		color: rgba(16, 16, 16, 1);
		font-size: 18px;
		font-weight: bold;
		position: relative;
	}

	.text text:nth-child(3) {
		color: rgba(16, 16, 16, 1);
		font-size: 14px;
	}

	.text text:nth-child(5) {
		color: rgba(16, 16, 16, 1);
		font-size: 14px;
	}

	.text {
		padding-left: 16px;
		padding-top: 17px;
		padding-bottom: 10px;
		border-bottom: 1px solid #F1F1F1;
	}

	.xx {
		margin: 10rpx 0;
	}

	.score {
		position: relative;
		margin: 5px 0;
	}

	.score text {
		margin: 10rpx 0;
	}

	.score text:nth-child(2) {
		position: absolute;
		right: 450rpx;
		color: rgba(108, 108, 108, 1);
		font-size: 14px;
		top: -10rpx;
	}

	.score text:nth-child(3) {
		position: absolute;
		color: rgba(16, 16, 16, 1);
		font-size: 12px;
		right: 300rpx;
		top: -13rpx;
	}

	.service {
		padding-top: 10px;
		padding-left: 31px;
	}

	.service text:nth-child(1) {
		color: rgba(16, 16, 16, 1);
		font-size: 16px;
	}

	.evaluate {
		padding-left: 36px;
		padding-top: 25px;
	}

	.evaluate>text:nth-child(1) {
		font-size: 16px;
		font-weight: 1000;
	}

	.evaluateList {
		padding-top: 10px;
		display: flex;
		line-height: 16px;
	}

	.avatar {
		width: 40px;
		height: 40px;
		border-radius: 100%;
	}

	.userMsg {
		padding: 0 15px;
		font-size: 14px;
	}

	.userMsg text:nth-child(2) {
		position: absolute;
		right: 36px;
	}

	.evaluateContent {
		padding-top: 5px;
		padding-right: 10px;
	}

	.twoBtn {
		background-color: #fff;
		display: flex;
		position: fixed;
		bottom: 0px;
	}

	.twoBtn-button {
		width: 100px;
		height: 45px;
		margin: 0 0 10px 28px;
	}

	.twoBtn image {
		width: 30px;
		height: 30px;
		margin-left: 30px;
	}

	.twoBtn-text {
		font-size: 16px;
		margin-top: -10px;
		margin-left: 15px;
	}

	.twoBtn button {
		width: 160px;
		height: 45px;
		border-radius: 100px;
		font-size: 16px;
		text-align: center;
	}

	.twoBtn>button:nth-child(2) {
		background-color: rgba(251, 171, 7, 1);
		color: rgba(255, 255, 255, 1);
		margin-left: 70px;
	}

	/* 遮罩层样式 */
	.overlay {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.6);
		/* 设置透明度为60% */
		z-index: 999;
		/* 确保遮罩层在最上层 */
	}

	/* 弹出框样式 */
	.modal {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		background-color: rgba(255, 255, 255, 1);
		/* 白色背景 */
		z-index: 1000;
		/* 确保弹出框在遮罩层之上 */
	}

	.modal-content {
		padding: 0px;
	}

	.modal-button {
		padding: 15px 0;
		text-align: center;
		border-bottom: #dfdfdf solid 1rpx;
	}
</style>